<template>
  <div class="gallery" @click="handleHidden">
    <div class="wrapper">
      <swiper :options="swiperOption">

          <swiper-slide v-for="(item,index) of gallaryImg" :key="index">
            <img class="swiper-img" :src="item" alt="">
          </swiper-slide>


        <!--<swiper-slide >-->
          <!--<img class="swiper-img" src="https://imgs.qunarzz.com/p/tts4/1809/3c/58114a9fcb33302.jpg" alt="">-->
        <!--</swiper-slide>-->
        <div class="swiper-pagination" slot="pagination"></div>
      </swiper>


    </div>
  </div>
</template>

<script>
  export default {
    name: "gallery",
    props:{
      gallaryImg:{
        type:Array
      }
    },
    data () {
      return {
        hiddenGallery:false,
        swiperOption:{
          pagination:'.swiper-pagination',
          paginationType:'fraction',
          observeParents: true,
          observer: true
        }
      }
    },
    methods:{
      handleHidden(){
        console.log('haha');
        this.$emit('close',this.hiddenGallery)
      }
    }
  }
</script>

<style lang="stylus" scoped>
  .wrapper >>> .swiper-container
    overflow:inherit
  .gallery
    z-index:9999
    display: flex
    flex-direction: column
    justify-content: center
    position: fixed
    top: 0
    left: 0
    right: 0
    bottom: 0
    background-color: #000
    .wrapper

      width: 100%
      height: 0
      padding-bottom: 100%
      .swiper-img
        width:100%
      .swiper-pagination
        color: #fff
        bottom:-1rem


</style>
